package com.hinacom.pix.entity;

import ca.uhn.hl7v2.HL7Exception;
import org.apache.commons.lang.StringUtils;

import java.util.UUID;

/**
 * Created by fyu on 2016/8/31.
 */
public class PIXQueryParameter extends QueryParameter {
    private String identifier;
    private String tag;
    private PatientIdentifier parametersInsuccessivefields;
    private AssigningAuthority filterDomain;

    public String getTag() {
        if (StringUtils.isEmpty(this.tag)) {
            String subTag = UUID.randomUUID().toString().substring(0,8);
            subTag = String.valueOf(Long.parseLong(subTag,16));
            this.tag = String.format("QRY%s",subTag);
        }
        return this.tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public PatientIdentifier getParametersInsuccessivefields() {
        return parametersInsuccessivefields;
    }

    public void setParametersInsuccessivefields(PatientIdentifier parametersInsuccessivefields) {
        this.parametersInsuccessivefields = parametersInsuccessivefields;
    }

    public AssigningAuthority getFilterDomain() {
        return filterDomain;
    }

    public void setFilterDomain(AssigningAuthority filterDomain) {
        this.filterDomain = filterDomain;
    }

    public String getIdentifier() {
        return identifier;
    }

    public void setIdentifier(String identifier) {
        this.identifier = identifier;
    }
}
